#Boa:FramePanel:VarsPanel

import wx

[wxID_VARSPANEL, wxID_VARSPANELLIST, 
] = [wx.NewId() for _init_ctrls in range(2)]

class VarsPanel(wx.Panel):
    def _init_coll_boxSizer1_Items(self, parent):
        # generated method, don't edit

        parent.AddWindow(self.list, 1, border=0, flag=wx.GROW)

    def _init_coll_list_Columns(self, parent):
        # generated method, don't edit

        parent.InsertColumn(col=0, format=wx.LIST_FORMAT_LEFT, heading=u'name',
              width=-1)
        parent.InsertColumn(col=1, format=wx.LIST_FORMAT_LEFT, heading=u'type',
              width=-1)
        parent.InsertColumn(col=2, format=wx.LIST_FORMAT_LEFT, heading=u'shape',
              width=-1)

    def _init_sizers(self):
        # generated method, don't edit
        self.boxSizer1 = wx.BoxSizer(orient=wx.VERTICAL)

        self._init_coll_boxSizer1_Items(self.boxSizer1)

        self.SetSizer(self.boxSizer1)

    def _init_ctrls(self, prnt):
        # generated method, don't edit
        wx.Panel.__init__(self, id=wxID_VARSPANEL, name=u'VarsPanel',
              parent=prnt, pos=wx.Point(433, 265), size=wx.Size(130, 339),
              style=wx.TAB_TRAVERSAL)
        self.SetClientSize(wx.Size(122, 312))

        self.list = wx.ListCtrl(id=wxID_VARSPANELLIST, name=u'list',
              parent=self, pos=wx.Point(0, 0), size=wx.Size(122, 312),
              style=wx.LC_REPORT)
        self._init_coll_list_Columns(self.list)

        self._init_sizers()

    def __init__(self, parent, id, pos, size, style, name):
        self._init_ctrls(parent)
        [self.list.SetColumnWidth(i, wx.LIST_AUTOSIZE_USEHEADER) for i in range(self.list.GetColumnCount())]

    def regArray(self, name, a):
        # TODO: change varsPanel's list to virtual listctrl
        index = self.list.InsertStringItem(10000, name)
        self.list.SetStringItem(index, 1, str(a.dtype))
        self.list.SetStringItem(index, 2, repr(a.shape))
